﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="EventList.aspx.cs" Inherits="LizzabethBrownRealEstate.Views.Admin.EventList" %>
<%@ Import Namespace="LizzabethBrownRealEstate.Models" %>
<%@ Import Namespace="LizzabethBrownRealEstate.Controllers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div class="contentDiv" style="margin-left:25%; margin-top:25px">
        <fieldset style="margin-bottom: 20px;">
            <legend>Upcomming Events</legend>
            <% LBRDataContext c = new LBRDataContext(); %>
            <table width="100%" style="border-collapse:collapse;">
            <% foreach (Event e in c.Events.Where<Event>(e=>e.Deleted==false))
               {%>
               <tr style="cursor:pointer" onmouseover="javascript:this.style.backgroundColor='Silver';" onmouseout="javascript:this.style.backgroundColor='Transparent'">
                    <td><%= Html.Encode(e.Title) %></td>
                    <td><%= e.EventStart.Value.ToShortDateString() %> </td>
                    <td><a href='<%= Url.Action("EditEvent", new { Controller = "Admin", eventId = e.EventId })%>' class="linktableButton">Edit</a></td>
                    <td><a onclick="javascript:return confirm('Delete this resource?')" href='<%= Url.Action("DeleteEvent", new { Controller = "Admin", Id = e.EventId })%>' class="linktableButton">Delete</a></td>
               </tr>
            <%} %>
            </table>
        </fieldset>
    </div>
</asp:Content>
